<?php
	require_once("../../db/dbclass.php");
	require_once("../../utils/common.php");
	$myDb=&DbController::getInstance();
	$page=$_POST['page'];
	$page_s=($page-1)*10;
	$page_e=$page*10;
	$param="SELECT * FROM yj_user_info ORDER BY follow_num LIMIT $page_s,$page_e";
	// $param="SELECT * FROM yj_user_info ORDER BY follow_num LIMIT 0,10";
	$result=$myDb->exec_query($param);
	$array = array();
	if($result==TRUE){
		$i=0;
		while ($row=mysqli_fetch_array($result,MYSQL_ASSOC)) {
			$arrayName = array('user_id' =>$row['user_id'] , 
				'user_name'=>$row['user_name'],
				'follow_num'=>$row['follow_num'],
				'focus_num'=>$row['focus_num']
				);
			$array[$i++]=$arrayName;
		}
		$arr = array('result' => '1', 'users'=>$array);
		echo json_encode($arr);
		return ;
	}
	$arr = array('result' => '2', 'users'=>$array);
	echo json_encode($arr);
?>